package app.imttf.internal.backing.dynamicregion;

import oracle.adf.controller.TaskFlowId;

public class AppConfigDynamicBean {
    private String mainTaskFlow = "/WEB-INF/app-config-user.xml#app-config-user";
    private String roleTaskFlow = "/WEB-INF/app-config-role.xml#app-config-role";
    private String menuTaskFlow = "/WEB-INF/app-config-menu.xml#app-config-menu";
    private String kantor_cabangTaskFlow = "/WEB-INF/app-config-kantor_cabang.xml#app-config-kantor_cabang";
    private String currentTF = "main";

    public AppConfigDynamicBean() {
    }

    public TaskFlowId getDynamicTaskFlowId() {
        if (this.getCurrentTF().equalsIgnoreCase("main"))
            return TaskFlowId.parse(mainTaskFlow);
        else if (this.getCurrentTF().equalsIgnoreCase("role"))
            return TaskFlowId.parse(roleTaskFlow);
        else if (this.getCurrentTF().equalsIgnoreCase("menu"))
            return TaskFlowId.parse(menuTaskFlow);
        else if (this.getCurrentTF().equalsIgnoreCase("kantor_cabang"))
            return TaskFlowId.parse(kantor_cabangTaskFlow);
        else
            return TaskFlowId.parse(mainTaskFlow);
    }

    public void setCurrentTF(String currentTF) {
        this.currentTF = currentTF;
    }

    public String getCurrentTF() {
        return currentTF;
    }
}
